from utils import file

config_root = "/stores"

if not file.is_dir("/stores"):
    raise Exception("没有/stores配置文件目录，请先执行/init.py")


class BaseConfig:
    def __init__(self, path):
        self.__path = path
        self.load_config()

    def load_config(self):
        global config_root
        self.__config = file.load_json_file(f"{config_root}/{self.__path}")

    def get_config(self):
        return self.__config

    def print_config(self):
        print(self.__config)
